package org.contacts.dao.impl;

import org.contacts.dao.Contact;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * Created by nnazarov on 3/27/14.
 */
public class Test {
    public static void main(String[] args) throws SQLException {

//        DAOFactory contactDAOFactory = DAOFactory.getDAOFactory();
//        IContactDAO contactDAO = contactDAOFactory.getContactDAO();

//        contactDAO.deleteContact("777-777-7777");
//        contactDAO.findContact("777-777-7777");
//        String contacts = contactDAO.getContactsAsString();
//        System.out.println(contacts);
        ArrayList<Contact> contactList;
        ContactModel contactModel = new ContactModel();
        contactList = contactModel.getAllContacts();

        for(Contact c : contactList) {
            System.out.println(c.getFname() + "\t" +
                    c.getLname() + "\t" + c.getPhone());
        }
    }
}
